<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="id" label="编号" width="180" />
    <el-table-column prop="linkName" label="联系人" width="180" />
    <el-table-column prop="phone" label="电话" />
    <el-table-column prop="cgy" label="分类" />
  </el-table>
</template>

<script setup>
import {ref,reactive,onMounted} from 'vue'
import axios from '../axios/index.js'
import {useRouter} from 'vue-router'

const router=useRouter();
const tableData = ref([])
const loadData=()=>{
   axios
   .get("https://m1.apifoxmock.com/m1/6731094-6442317-default/list")
   .then((d)=>{
      if(d.data.code==2000){
         tableData.value=d.data.data;
      }else{
         alert("加载失败"+d.data.msg);
      }
   })
}
onMounted(()=>{
  
   loadData()
})//页面显示的时候自动触发

</script>
